<html>
<head><meta charset="utf-8"><title>Clang in run-make tests · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html">Clang in run-make tests</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="151272722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151272722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151272722">(Dec 10 2018 at 13:36)</a>:</h4>
<p>How hard would it be to make clang available for run-make tests? What would it take?</p>



<a name="151272771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151272771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151272771">(Dec 10 2018 at 13:37)</a>:</h4>
<p>(cc <span class="user-mention" data-user-id="116122">@simulacrum</span> <span class="user-mention" data-user-id="125254">@kennytm</span> <span class="user-mention" data-user-id="121055">@Pietro Albini</span> <span class="user-mention" data-user-id="116015">@Alex Crichton</span>)</p>



<a name="151272894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151272894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151272894">(Dec 10 2018 at 13:38)</a>:</h4>
<p>I'm talking about the clang that we already build for LLDB, i.e. a version that matches rustc's LLVM</p>



<a name="151272899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151272899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151272899">(Dec 10 2018 at 13:38)</a>:</h4>
<p>must it be "clang"? you could already use <code>$(CC)</code></p>



<a name="151272908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151272908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151272908">(Dec 10 2018 at 13:39)</a>:</h4>
<p>Yes, it must be Clang</p>



<a name="151272930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151272930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151272930">(Dec 10 2018 at 13:39)</a>:</h4>
<p>the use case would be testing cross-language optimizations</p>



<a name="151273352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151273352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151273352">(Dec 10 2018 at 13:47)</a>:</h4>
<p>If it's already built, should be quite easy... we don't have the budget to build it though</p>



<a name="151273365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151273365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151273365">(Dec 10 2018 at 13:47)</a>:</h4>
<p>time wise</p>



<a name="151275521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151275521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151275521">(Dec 10 2018 at 14:22)</a>:</h4>
<p>I think it should cache very well via sccache. I don't know if we build the final executable currently, but we are building libclang for the LLDB component.</p>



<a name="151294125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151294125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151294125">(Dec 10 2018 at 18:34)</a>:</h4>
<p>I don't think it'd be too too hard b/c we're already compiling the compiler's LLVM with clang on most builders</p>



<a name="151294131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151294131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151294131">(Dec 10 2018 at 18:34)</a>:</h4>
<p>I suspect we'd probably add an opt-in flag to enable the tests but we could enable that on the bots</p>



<a name="151432229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151432229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151432229">(Dec 11 2018 at 09:15)</a>:</h4>
<p>It would have to be a clang that matches the LLVM version of rustc though.</p>



<a name="151449311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151449311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151449311">(Dec 11 2018 at 14:31)</a>:</h4>
<p>OK, I just did some testing and it seems that clang is already available in <code>run-make-fulldeps</code> because it ends up in the <code>llvm/bin</code> directory with the other LLVM tools. It's only built if <code>rust.lldb</code> is set in <code>config.toml</code>.</p>



<a name="151449390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151449390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151449390">(Dec 11 2018 at 14:33)</a>:</h4>
<p>I guess we don't want to build clang by default together with LLVM, so I'm wondering what the best option would be here.</p>



<a name="151449550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151449550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151449550">(Dec 11 2018 at 14:35)</a>:</h4>
<p>one thing we could do is:<br>
 1. provide a simple way for run-make tests to check whether clang is available and has the right version, and then<br>
 2. enable building lldb for some of the CI jobs</p>



<a name="151449599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151449599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151449599">(Dec 11 2018 at 14:35)</a>:</h4>
<p>that's a bit brittle though since if someone disables building lldb for some reason, tests would go ignored and no one would notice...</p>



<a name="151449815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151449815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151449815">(Dec 11 2018 at 14:38)</a>:</h4>
<p>is there a way to build clang "lazily", i.e. only when run-make-fulldeps is executed?</p>



<a name="151450042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151450042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151450042">(Dec 11 2018 at 14:41)</a>:</h4>
<p>You can probably make sure that <a href="https://github.com/rust-lang/rust/blob/master/src/bootstrap/test.rs#L733" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/bootstrap/test.rs#L733">https://github.com/rust-lang/rust/blob/master/src/bootstrap/test.rs#L733</a> gets a <code>ensure</code> method call for <code>clang</code> only when running <code>run-make-fulldeps</code></p>



<a name="151451277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151451277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151451277">(Dec 11 2018 at 14:58)</a>:</h4>
<p>I don't think that quite works because we already need to know whether LLDB/Clang needs to be built when LLVM is being built. At least it looks like that in the current setup.</p>



<a name="151451328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Clang%20in%20run-make%20tests/near/151451328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Clang.20in.20run-make.20tests.html#151451328">(Dec 11 2018 at 14:59)</a>:</h4>
<p>see: <a href="https://github.com/rust-lang/rust/blob/3a3121337122637fa11f0e5d42aec67551e8c125/src/bootstrap/native.rs#L201" target="_blank" title="https://github.com/rust-lang/rust/blob/3a3121337122637fa11f0e5d42aec67551e8c125/src/bootstrap/native.rs#L201">https://github.com/rust-lang/rust/blob/3a3121337122637fa11f0e5d42aec67551e8c125/src/bootstrap/native.rs#L201</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>